function showLoginLightBox()
{    
    var h=$(document).height();
    var w=$(document).width();
    $("<div id='ContentDiv'></div>").insertAfter("body")
    $("<div id='MaskDiv'></div>").insertAfter("body");
    $("#ContentDiv").css({
                    "background-color":"white",
                    "width":"400px",
                    "height":"300px",
                    "position":"absolute",
                    "top":"0px",
                    "left":"0px",
                    "z-index":"200"});
    $("#MaskDiv").css({
                    "background-color":"black",
                    "width":"0px",
                    "height":"0px",
                    "position":"absolute",
                    "top":"0px",
                    "left":"0px",
                    "z-index":"100",                    
                    "opacity":"0.7"});            
    
    $.get("../tools/LoginPanel.jsp",null,function(xx){
        $("#ContentDiv").html(xx);
        $("<p style='text-align:right'><a id='CloseLink' href='#'>關閉</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>").insertBefore("#LoginTable");    
        $("#CloseLink").click(function(){
            $("#MaskDiv").remove();
            $("#ContentDiv").remove();
        });
        
        //Ajax登入
        $("#OKBtn").click(function(){        
            $("#MsgDiv").remove();
            var pp=$.param({"account":$("#account").val(),"password":$("#password").val()});
            $.post("../tool/AjaxLogin",pp,function(xx){                
                if(xx.trim()=="t")
                {
                    $("#MaskDiv").remove();
                    $("#ContentDiv").remove();
                    location.reload();      //重新整理本頁
                } 
                else
                {
                    $("<div id=\"MsgDiv\" style=\"width:100%;text-align:center;color:red;font-weight:bold;\">帳號或密碼有誤</div>").insertAfter("#LoginTable");
                }
            },"text");
        });        
    },"html");      
    $("#MaskDiv").css({"height":h,"width":w}).show();                    
    if(h>1000)h=768;
    $("#ContentDiv").css({"left":(w-400)/2,"top":(h-250)/2}).show();               
}


